package com.day12.ex06;

public class Student {
    private String name;
    private int age;
    public Student(){}
    public Student(String name, int age){
        this.name = name;
        this.age = age;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }
    @Override
    public boolean equals(Object o){
        if(this==o){
            return true;
        }
        if (o==null||o.getClass()!=this.getClass()){
            return false;
        }
        Student s = (Student)o;
        if(age!=s.age){
            return false;
        }
        return  name!=null?name.equals(s.name):s.name==null;
    }

    public void setAge(int age) {
        this.age = age;
    }
}
